<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>instanceof</title>
</head>

<body>
    <!-- 
        1. instanceof 是如何判断的？
            表达式： A instanceof B
            如果B函数的显式原型对象在A对象的原型链上，返回true，否则返回false    
     -->
    <script>
        function Fn() {

        }
        let fn1 = new Fn()
        // true
        console.log(fn1 instanceof Fn)
        // true
        console.log(fn1 instanceof Object)

        // 都是true
        console.log(Object instanceof Function)
        console.log(Object instanceof Object)
        console.log(Function instanceof Function)
        console.log(Function instanceof Object)
        // false
        console.log(Object instanceof Fn)
    </script>
</body>

</html>